<div>
    <!-- Nav tabs -->
    <ul class="nav nav-tabs" role="tablist">
        {@each data.versionList as version}
        <li role="presentation" {@if data.nowVersion == version.version}class="active"{@/if}>
            <a href="#${version.id}" aria-controls="${version.id}" role="tab" data-toggle="tab" user-target="tab_main">版本${version.version}{@if data.nowVersion == version.version}(当前生效的版本){@/if}</a>
        </li>
        {@/each}

    </ul>
    <!-- Tab panes -->
    <div class="tab-content">
        {@if data.versionList}
            {@each data.versionList as version}
            <div role="tabpanel" class="tab-pane {@if data.nowVersion == version.version}active{@/if}" id="${version.id}" style="padding: 10px">
                {@if data.template && version.version == data.nowVersion}
                    <form class="form-horizontal" role="form" id="${version.id}_form" action="javascript:void(0);" method="post">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">抽佣门槛（元）</label>
                            <div class="col-sm-10">
                                <input type="text" id="basePriceFee_${version.id}" name="basePriceFee" class="form-control" placeholder="抽佣门槛（元）" value="${data.template.basePriceFee/100}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">生效日期</label>
                            <div class="col-sm-10">
                                <div class="input-group date form_date" data-date="" data-date-format="yyyy-mm-dd">
                                    <input class="form-control" id="startDate_${version.id}" name="startDate" size="32" type="text" value="${data.template.startDateFormat}" readonly>
                                    <span class="input-group-addon"><span class="glyphicon glyphicon-time"></span></span>
                                </div>

                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">技术服务费费率（%）</label>
                            <div class="col-sm-10">
                                <table width="100%" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td width="30%" height="300">
                                            <div style="height: 300px;overflow: auto">
                                                <ul class="nav nav-tabs nav-stacked nav-tabs-justified" role="tablist">
                                                    {@each data.template.commissionRuleMap as commissionRule,index}
                                                    <li role="presentation">
                                                        <a href="#${commissionRule.id}_${version.id}" aria-controls="${commissionRule.id}_${version.id}" role="tab" data-toggle="tab">${commissionRule.name}</a>
                                                    </li>
                                                    {@/each}
                                                </ul>
                                            </div>
                                        </td>
                                        <td valign="top">
                                            <div class="tab-content" style="height: 300px;overflow: auto">
                                                {@each data.template.commissionRuleMap as commissionRule,index}
                                                <div role="tabpanel" class="tab-pane " id="${commissionRule.id}_${version.id}" style="padding: 10px">
                                                {@each commissionRule.list as commission}
                                                    <div class="form-group">
                                                        <label class="col-sm-8 control-label">${commission.categoryName}(%)</label>
                                                        <div class="col-sm-4">
                                                            <input type="text" id="${commission.id}" name="${commission.categoryId}" class="form-control" placeholder="技术服务费费率" value="${commission.rate/100}">
                                                        </div>
                                                    </div>
                                                {@/each}
                                                </div>
                                                {@/each}
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                        <div class="form-group" style="text-align: right;padding-right: 10px;">
                            <button type="button" id="add_${version.id}" class="btn btn-danger" data-id="${version.id}">以当前模板新增</button>
                            {@if data.template.editable}
                            <button type="button" id="save_${version.id}" class="btn btn-primary" data-id="${version.id}">保存</button>
                            {@/if}
                        </div>
                    </form>
                {@/if}
            </div>
            {@/each}
        {@/if}
    </div>
</div>